Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linux/rpath: fix relative path finding for symlinked dirs #225

Merged

Conversation

pmolodo
Copy link
Contributor

@pmolodo pmolodo commented Jan 30, 2020

This fixes linking issues if you happen to have a symlink as part of your build path.

Previously, mayaUsd_add_rpath would use "realpaths" when comparing to origin, but mayaUsd_init_rpath would ONLY use a realpath if the argument was originally a relative path. Thus, if you fed in an absolute path with a symlink, you would end up comparing a symlink path to a realpath.

@pmolodo
Copy link
Contributor Author

pmolodo commented Jan 30, 2020

This addresses the note mentioned here:

#198 (review)
#198 (comment)

@HamedSabri-adsk HamedSabri-adsk added the do-not-merge-yet Development is not finished, PR not ready for merge label Feb 1, 2020
@kxl-adsk
Copy link

kxl-adsk commented Feb 2, 2020

@elrond79 what's the simplest way to reproduce the issue using our build script?

@pmolodo
Copy link
Contributor Author

pmolodo commented Feb 3, 2020

This was on Linux - add args (ie, --pxrusd-location, etc) as needed to find your dependencies.

# The problem seems to crop up on rebuilds - to simulate, we pre-create this dir
mkdir -p /tmp/dir1/dir2/dir3/workspace/install/RelWithDebInfo/plugin/al/lib
ln -s /tmp/dir1/dir2/dir3 /tmp/symlinkDir
python $MAYA_USD_SRC/build.py /tmp/symlinkDir/workspace -v 3 --stages configure,build,install

The above build should appear to complete successfully - however, if you inspect some of the libs, you'll see they have linking problems - ie:

...which should show:

libAL_USDTransaction.so => not found

You can also inspect the RUNPATH directly, to see that it's going up the wrong number of directories:

readelf -a /tmp/symlinkDir/workspace/install/RelWithDebInfo/plugin/al/lib/python/AL/usd/transaction/_AL_USDTransaction.so | grep RUNPATH

@kxl-adsk kxl-adsk requested review from ppt-adsk and removed request for HamedSabri-adsk February 5, 2020 14:57
@kxl-adsk kxl-adsk removed the do-not-merge-yet Development is not finished, PR not ready for merge label Feb 5, 2020
@kxl-adsk kxl-adsk merged commit f3224f6 into Autodesk:dev Feb 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants